#ifndef ABCLISTVIEW_H
#define ABCLISTVIEW_H

#include <QWidget>
#include <QWidget>
#include <QString>
#include "listviewshowitem.h"
#include <QAbstractListModel>

#include <QLabel>
class QAbstractItemDelegate;
class TListView;
class ABCDialog;

namespace Ui {
class AbcListView;
}

class AbcListView : public QWidget
{
    Q_OBJECT

public:
    explicit AbcListView(QWidget *parent = 0);
    ~AbcListView();
    void setModel (QAbstractListModel * model,int num);
    void setCheckNum(int num);

    void setItemDelegate ( QAbstractItemDelegate * delegate );
    void setShowItems(const QList<ListViewShowItem> &item);
    void setABCDialogPos(int x,int y);
    TListView *getListView();
    QLabel *getTitleLabel(const QString &str);

    void setBarEnable(bool b);
    void setBarHeight(int height);
    void setBarCharSize(int size);
    void setBarSize(int a,int b);

private:
#ifdef STRABC
    int getSelect(QString str);
#else
    int getSelect(char c);
#endif

private slots:
#ifdef STRABC
    void updateDilog(QString str);
#else
    void updateDilog(char c);
#endif

    void dialogShow();
    void dialogHide();
private:
    int mLetterPos[28];
    Ui::AbcListView *ui;
    TListView *mListView;
    ABCDialog *mABCDialog;
    QAbstractListModel *mModel;

    //QList<QString> dataList;


    int mCheckNum;
};

#endif // ABCLISTVIEW_H
